package java56_4;

import java.util.Scanner;

public class GuessNum {

	public static void main(String[] args) {
		// 猜数。。。输入我们的猜测数，提示是大了还是小了，还是猜对了。。。
		int g = (int) (Math.random() * 100);// 0-100
		Scanner sc = new Scanner(System.in);
		int num = -1;
		// 操作：输入一个数，判断是对了还是大了还是小了
		do {
			System.out.println("请输入你猜的数：");
			num = sc.nextInt();
			if (num > g)
				System.out.println("大了");
			else if (num < g)
				System.out.println("小了");
		} while (num != g);
		System.out.println("猜对了");
	}
}
